-- card: 37353 from stack: in.0 -- bmap block id: 0 -- flags: 0000 -- background id: 3797 -- name: -- part contents for background part 1 ----- text ----- From: edmoy@violet.berkeley.edu Date: 10 Mar 88 19:48:15 GMT >I am looking for this, and basically do the following: > if ( (target = OpenResFile( targetFile )) == -1 ) > { CreateResFile( targetFile ); > if ( ResError() != noErr ) > { > return; > } > else if ( target = OpenResFile( targetFile ) == -1 ) > { > return; > } > } If this is exactly the code you use, then the problem is in: else if ( target = OpenResFile( targetFile ) == -1 ) You forgot the extra pair of parenthesis, as in else if ((target = OpenResFile( targetFile )) == -1 ) What you were doing is calling OpenResFile() and testing if it was -1. If it was, target was set to 1 (true) and your routine started to do its thing on what every resource file 1 was (maybe the System file). Although I would have expected that OpenresFile() to return a positive number, which doesn't match -1, so target becomes 0 and your routine returns. -- part contents for background part 45 ----- text ----- Re: the target